<div class="release-app-wrap" id="uploadAppleApp" style="overflow: hidden">
  <div class="signature1">
    <!--面包屑导航-->
    <div class="crumbs iframe-crumbs">
      <img class="crumbs_icon" src="./static/crumbs_icon.png" />
      <a href="./sign">TF签名</a><span>/</span>上传苹果应用
    </div>
    <!--/面包屑导航-->
    <div class="sign-top-tip" style="margin-left: 280px">
      <img class="fl" src="./static/head_tip_icon.png" />
      <p style="margin-left: 40px">
        严格禁止以下类型app [直播、彩票、黄
        ]，棋牌类内部不可包含百家乐、XXX彩等，社交类APP必须保证纯绿色，金融类APP必须保证正规，任何违规APP都禁止签名，先咨询客服，违规app下架后损失自行承担！！
      </p>
    </div>

    <!--签名流程-->
    <div class="con">
      <div class="clearfix">
        <div class="left-collapse-box sidebar-fixed">
          <div class="left">
            <ul>
              <li>
                <a href="javascript:void(0);" class="left-collapse-title"
                  ><img src="./static/right_bold.png" />TF签名</a
                >
              </li>
              <li class="active">
                <a href="javascript:;">
                  <span class="iconfont icon-upload1"></span>
                  上传苹果应用
                </a>
              </li>
              <li>
                <a
                  href="javascript:;"
                  id="tfSignInner"
                  onclick="switchTab('tfSignInner')"
                >
                  <span class="iconfont icon-qianming"></span>
                  我的签名
                </a>
              </li>
            </ul>
          </div>
        </div>
        <div class="right-collapse-box">
          <div class="right">
            <!--1-->
            <div class="step1 release-app" v-if="uploadedState === 0">
              <div class="upload-file">
                <div
                  class="row tag-box tag-box-v5"
                  id="container"
                  style="position: relative"
                >
                  <div class="span12">
                    <div id="bootstrapped-fine-uploader"></div>

                    <div class="qq-uploader-selector qq-uploader span12">
                      <div id="upprocess" style="display: none">
                        <span
                          class="qq-drop-processing-selector qq-drop-processing"
                        >
                          <span
                            class="
                              qq-drop-processing-spinner-selector
                              qq-drop-processing-spinner
                            "
                          ></span>
                        </span>
                        <div class="upload-app-icon" id="loading"></div>
                        <div class="loadend"></div>
                        <ul class="qq-upload-list-selector qq-upload-list">
                          <li>
                            <div style="margin-bottom: 20px">
                              <span id="upload-app-name">正在解析...</span>
                            </div>
                            <div
                              class="
                                qq-progress-bar-container-selector
                                progress progress-striped
                                active
                              "
                            >
                              <div
                                class="
                                  qq-progress-bar-selector
                                  progress-bar progress-bar-warning
                                "
                                role="progressbar"
                              ></div>
                            </div>
                            <span
                              class="
                                qq-upload-spinner-selector qq-upload-spinner
                                alreadyup
                              "
                              style="width: auto; font-size: 14px"
                            ></span>
                            <span
                              class="qq-upload-file-selector qq-upload-file"
                            ></span>
                            <span
                              class="
                                qq-upload-size-selector qq-upload-size
                                tolsize
                              "
                              style="width: auto; font-size: 14px"
                            ></span>
                            <br />
                            <br />
                            <a
                              class="
                                qq-upload-cancel-selector
                                btn-u btn-u-default
                                ms-btn ms-btn-default
                              "
                              href="javascript:;"
                              id="changest"
                              >暂停上传</a
                            >
                            <span
                              class="
                                qq-upload-status-text-selector
                                qq-upload-status-text
                              "
                            ></span>
                            <div
                              id="retry"
                              style="display: none; margin-top: 20px"
                            >
                              <a
                                class="btn-u btn-u-default"
                                href="javascript:void(0);"
                                onclick="javascript:retry();"
                                >重新上传</a
                              >
                            </div>
                          </li>
                        </ul>
                      </div>
                      <div class="col-md-12">
                        <div
                          class="qq-upload-button-selector"
                          style="width: auto"
                          id="upbtn"
                        >
                          <div style="margin-bottom: 30px">
                            <img src="./static/upload-yun.png" />
                          </div>
                          <div>
                            <!--  -->

                            <button
                              class="ms-btn ms-btn-primary upload-btn"
                              type="file"
                              id="uploadstart"
                              @click="uploadstart"
                              style="
                                width: 240px;
                                padding: 0px;
                                background: linear-gradient(
                                  60deg,
                                  #3350dc 0%,
                                  #4d6af4 100%
                                );
                                height: 60px;
                                font-size: 18px;
                                line-height: 58px;
                                border-radius: 30px;
                                z-index: 1;
                              "
                              data-id="0"
                            >
                              <span class="iconfont icon-upload"></span>
                              <span class="text">立即上传</span>
                            </button>
                          </div>
                          <div style="margin-top: 20px"></div>
                          点击按钮选择应用的安装包，或拖拽文件到此区域
                          <br />
                          （仅支持.ipa，单个文件最大支持
                          <span style="color: red; font-size: 14px"> 1G</span>）
                        </div>
                      </div>
                    </div>
                  </div>
                  <div
                    id="html5_1f50pt2beftt1k173231q5ek9u4_container"
                    class="moxie-shim moxie-shim-html5"
                    style="
                      position: absolute;
                      top: 253px;
                      left: 493px;
                      width: 240px;
                      height: 60px;
                      overflow: hidden;
                      z-index: 0;
                    "
                  >
                    <input
                      id="ipa-file"
                      type="file"
                      @change="fileSelect"
                      style="
                        font-size: 999px;
                        opacity: 0;
                        width: 100%;
                        height: 100%;
                        z-index: -1;
                        position: relative;
                        top: 11110px;
                      "
                      accept=".ipa"
                    />
                  </div>
                </div>
              </div>
            </div>

            <!--2-->
            <div class="step2 step-common" v-if="uploadedState === 2">
              <div class="tit">请填写APP签名信息</div>
              <form
                class="form-submitInfo form-horizontal"
                id="app_setting_form"
                method="post"
                action="./sign/info"
              >
                <div class="form-group clearfix app-name">
                  <div class="col-sm-2 control-label">APP名称</div>
                  <div class="col-sm-2" v-if="form.logo">
                    <img :src="form.logo" />
                  </div>
                  <div class="col-sm-4">{{form.appName}}</div>
                </div>
                <div class="form-group clearfix">
                  <label class="control-label col-sm-2"
                    ><span>*</span>Q Q号</label
                  >
                  <div class="col-sm-6">
                    <input
                      type="text"
                      v-model="form.qq"
                      class="form-control"
                      rows="5"
                      placeholder="请填写真实有效的QQ，方便客服联系"
                      name="qq"
                    />
                    <span class="error-prompt">请填写真实有效的QQ号</span>
                  </div>
                </div>
                <div class="form-group clearfix">
                  <label class="control-label col-sm-2"
                    ><span>*</span>常用邮箱</label
                  >
                  <div class="col-sm-6">
                    <input
                      type="text"
                      v-model="form.email"
                      class="form-control"
                      rows="5"
                      placeholder="请填写真实有效的邮箱地址，方便客服联系"
                      name="email"
                    />
                    <span class="error-prompt">请输入正确的邮箱</span>
                  </div>
                </div>
                <div class="form-group clearfix">
                  <label class="control-label col-sm-2"
                    ><span>*</span>测试帐号</label
                  >
                  <div class="col-sm-6">
                    <input
                      type="text"
                      v-model="form.account"
                      class="form-control"
                      rows="5"
                      placeholder="请填写登录APP的帐号"
                      name="trial"
                      value=""
                    />
                  </div>
                </div>
                <div class="form-group clearfix">
                  <label class="control-label col-sm-2"
                    ><span>*</span>测试密码</label
                  >
                  <div class="col-sm-6">
                    <input
                      type="password"
                      v-model="form.password"
                      class="form-control"
                      rows="5"
                      placeholder="请填写登录APP的密码"
                      name="password"
                      value=""
                      autocomplete="new-password"
                    />
                  </div>
                </div>
                <div class="form-group clearfix">
                  <label class="control-label col-sm-2"
                    ><span>*</span>选择有效期</label
                  >
                  <div class="col-sm-6">
                    <el-radio-group
                      v-model="form.expireTime"
                      style="margin-top: 5px"
                    >
                      <el-radio label="1个月">1个月</el-radio>
                      <el-radio label="3个月">3个月</el-radio>
                      <el-radio label="6个月">6个月</el-radio>
                      <el-radio label="1年">1年</el-radio>
                    </el-radio-group>
                  </div>
                </div>

                <div class="form-group clearfix mt40">
                  <div class="col-sm-6">
                    <button
                      type="button"
                      @click="save"
                      class="
                        ms-btn ms-btn-primary
                        submitInfo
                        change-step-btn
                        next-btn
                      "
                    >
                      保存
                    </button>
                  </div>
                </div>
              </form>
            </div>
            <!--/2-->
          </div>
        </div>
      </div>
    </div>
  </div>
  <!--/签名流程-->
</div>

<script type="text/javascript" src="./static/qrcode.js"></script>

<script type="text/javascript" src="./static/jquery.cookie.js"></script>
<script type="text/javascript" src="./static/app-info-parser.min.js"></script>
<script>
  isHideFooter = true;
  var user_money = parseFloat("0.00");

  new Vue({
    el: "#uploadAppleApp",
    data: {
      form: {
        account: "",
        password: "",

        appName: "",
        logo: "",
        fileName: "",
        filePath: "",

        email: "",
        qq: "",
        expireTime: "1个月",
        type: 1, // 1：TF，2：企业账号
      },
      uploadList: [],
      uploadedState: 0, // 0未上传，1上传中，2上传成功，3上传失败
      loading: null,
    },
    methods: {
      selectFile(param){
            // 上传文件
            let files = param;
            if(files.length === 0){
                return;
            }
            let len = files.length;
            this.uploadList = [];
            for(let i=0; i<len; i++){
                this.uploadList.push(files[i]);
            }
            if(this.uploadList.length){
                this.rightUploadClick();
            }
            this.uploadedState = 1;
            this.loading = this.$loading({
              lock: true,
              text: '上传中',
              spinner: 'el-icon-loading',
            });
            // $('#storage-file').val('');
        },
        rightUploadClick() {
            // 上传前获取七牛token
            axios({
                method: "POST",
                url: baseUrl + "/transfer/upToken",
            }).then(({ data }) => {
                if (data.code === 200) {
                    this.uploadToken = data.result;
                    this.start();
                    
                    // 每个文件上传前-校验
                    // this.uploadList.forEach(item => {
                    //   item.uploadFileName = item.name;
                    // })
                } else {
                    this.$message({
                        message: data.message,
                        type: "warning",
                    });
                }
            });
        },
        start(){
            let file = this.uploadList[0];
            this.uploadFile(file)
                .then(res => {
                  this.form.fileName = this.uploadList[0].name;
                  this.form.filePath = res.key;
                  this.uploadedState = 2;
                  this.loading.close();
                  // axios({
                  //     method: "POST",
                  //     url: baseUrl + "/storage/upload",
                  //     headers: {
                  //       authorization: localStorage.getItem("token")
                  //     },
                  //     data: {
                  //       fileName: this.uploadList[0].name, // 七牛返回的hash
                  //       filePath: res.key, // 文件ID	
                  //       size: this.uploadList[0].size, // 文件ID	
                  //     },
                  // }).then(({ data }) => {
                  //   if (data.code === 200) {
                  //       let result = data.result;
                  //       this.loading.close();
                  //       this.uploadedState = 2;
                  //   } else {
                  //       this.uploadedState = 3;
                  //       this.$message({
                  //           message: data.message,
                  //           type: "warning",
                  //       });
                  //   }
                  // });
                })
        },
        uploadFile(file) {
            // 文件上传至七牛
            return new Promise((resolve, reject) => {
              let uptoken = this.uploadToken;
              // let path = this.getPath();
              let path = new Date().getTime() + '/';
              
              
              let key = ''; //这是上船后返回的文件名，这里为了避免重复，加上了时间戳和随机数
              var config = {
                  useCdnDomain: true, //表示是否使用 cdn 加速域名，为布尔值，true 表示使用，默认为 false。
                  region: null, // 选择上传域名区域；当为 null 或 undefined 时，自动分析上传域名区域。
                  domain: "http://image.jdwxtech.com", //配置好的七牛云域名  如   https://cdn.qniyun.com/
                  chunkSize: 50, //每个分片的大小，单位mb，默认值3
                  concurrentRequestLimit: 4, // 分片上传的并发请求量，number，默认为3；因为浏览器本身也会限制最大并发量，所以最大并发量与浏览器有关。
                  forceDirect: false, //直传还是断点续传方式，true为直传
              };
              var putExtra = {
                  fname: file.name, //文件原始文件名
                  params: {},
                  mimeType: file.raw ? file.raw.type : file.type,
                  // ...config,
              };
              
              key = path + file.name;
              var observable = qiniu.upload(
                  file,
                  key,
                  uptoken,
                  putExtra,
                  config
              );
            //   let fileLoadSize = 0;
              this.subscription = observable.subscribe({
                  next: (result) => {
                      //主要用来展示进度

                  },
                  error: (err) => {
                      //上传错误后触发
                      reject(err);
                  },
                  complete: (result) => {
                      //上传成功后触发。包含文件地址。
                      resolve(result);
                  },
              });
            });
        },
      save() {
        axios({
          method: "POST",
          url: baseUrl + "/pkg/save",
          headers: {
            authorization: localStorage.getItem("token"),
          },
          data: this.form,
        }).then(({ data }) => {
          // this.loading.close();
          if (data.code === 200) {
            this.uploadedState = 0;
            this.$message({
              message: '保存成功',
              type: "success",
            });

            
            // this.list = data.result.records;
          } else {
            this.$message({
              message: data.message,
              type: "warning",
            });
          }
        });
      },
      uploadstart() {
        document.querySelector("#ipa-file").click();
      },
      fileSelect() {
        var files = document.getElementById("ipa-file").files;
        this.selectFile(files);
        debugger
        var parser = new AppInfoParser(files[0]);
        parser
          .parse()
          .then((result) => {
            this.form.appName = result.CFBundleDisplayName;
            this.form.fileName = result.CFBundleDisplayName;
            this.form.logo = result.icon;
          })
          .catch((err) => {
            console.log(err);
          });
      },
    },
  });






  $(function () {
    // 验证qq
    function validationQq(obj) {
      var qqReg = /[1-9]([0-9]{4,11})/;
      if (qqReg.test(obj)) {
        return true;
      } else {
        return false;
      }
    }

    // 验证邮箱
    function validationEmail(obj) {
      var emailReg = /\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/;
      if (emailReg.test(obj)) {
        return true;
      } else {
        return false;
      }
    }


    $(".list1").on("click", "li", function () {
      if ($(this).hasClass("disabled")) return;
      console.info($(this).attr("class"));
      var service_id = $(this).find("input[name='service_id']").val();
      var level = $(this).data("level");
      if (level == 1) {
        $(".certTips").show();
      } else {
        $(".certTips").hide();
      }
      if (level == 4) {
        $(".pushTips").show();
      } else {
        $(".pushTips").hide();
      }
      if (level == 5) {
        $(".nosignTips").show();
      } else {
        $(".nosignTips").hide();
      }
      $.getJSON("/purchase/discount", { id: service_id }, function (result) {
        $(".list2").html(result.data.html);
        $(".money span").text("￥" + result.data.money);
        $("[data-toggle='tooltip']").tooltip();
        if (result.data.money > user_money) {
          $(".price-pay li[data='balance']").addClass("disabled");
          if ($(".price-pay li[data='balance']").hasClass("active")) {
            $(".price-pay li[data='balance']").removeClass("active");
            $(".price-pay li[data='alipay']").addClass("active");
          }
        } else {
          $(".price-pay li[data='balance']").removeClass("disabled");
        }
      });
    });

    $(".common").on("click", "li", function () {
      price = $(".list2 li.active input[name='price']").val();
      quantity = $(".list2 li.active input[name='quantity']").val();
      discount = $(".list2 li.active input[name='discount']").val();
      amount = parseFloat(price);
      if (amount > user_money) {
        $(".price-pay li[data='balance']").addClass("disabled");
        if ($(".price-pay li[data='balance']").hasClass("active")) {
          $(".price-pay li[data='balance']").removeClass("active");
          $(".price-pay li[data='alipay']").addClass("active");
        }
      } else {
        $(".price-pay li[data='balance']").removeClass("disabled");
      }
      $(".money span").text("￥" + amount);
    });

    $(document).on("click", ".toPay", function () {
      var _this = $(this);
      // 获取套餐
      var id = $(".list2 li.active input[name='discount_id']").val();
      // 商品ID
      var goodsId = "0";
      if (!id || !goodsId) {
        alert("请选择需要购买的套餐和商品");
        return;
      }
      // 获取支付渠道
      channel = $(".list3 li.active").attr("data");
      if (!channel || channel == "undefined") {
        alert("请选择支付渠道");
        return;
      }

      var user = $(".contrary-transfer input[name=user]");
      var phoneNum = $(".contrary-transfer input[name=phoneNum]");
      var remittanceName = $(".contrary-transfer input[name=remittanceName]");
      var remittanceAccount = $(
        ".contrary-transfer input[name=remittanceAccount]"
      );
      var phoneValidation = /0?(13|14|15|16|17|18|19)[0-9]{9}/;

      // 验证联系人
      if (user.val().length > 0) {
        user.removeClass("form-error");
      } else {
        user.addClass("form-error");
      }
      // 验证联系人手机号
      if (phoneValidation.test(phoneNum.val())) {
        phoneNum.removeClass("form-error");
      } else {
        phoneNum.addClass("form-error");
      }
      // 验证汇款名称
      console.log(remittanceName.val());
      if (remittanceName.val().length > 0) {
        remittanceName.removeClass("form-error");
      } else {
        remittanceName.addClass("form-error");
      }
      // 验证汇款账户
      if (remittanceAccount.val().length > 0) {
        remittanceAccount.removeClass("form-error");
      } else {
        remittanceAccount.addClass("form-error");
      }

      dataJson = "";
      if ($("#contraryTransfer").hasClass("active")) {
        if ($(".contrary-transfer .form-error").length > 0) {
          return false;
        }
        transfer = {};
        transfer.user_name = user.val();
        transfer.mobile = phoneNum.val();
        transfer.transfer_name = remittanceName.val();
        transfer.transfer_no = remittanceAccount.val();
        dataJson = "&transfer=" + JSON.stringify(transfer);
      }

      $(".pay-money a:last").addClass("disabled");
      $(".pay-money a:last").removeClass("toPay");
      if (channel == "balance") {
        alert(
          "是否确认购买此套餐？",
          function () {
            $("#msModal8").modal("show");
            $.ajax({
              async: true,
              type: "POST",
              url: "/buy",
              data:
                "discount_id=" +
                id +
                "&goods_id=" +
                goodsId +
                "&pay_channel=" +
                channel +
                dataJson,
              dataType: "json",
              beforeSend: function () {
                if (channel == "balance") {
                  $("#submitLoading").modal("show");
                }
              },
              success: function (result) {
                $(".pay-money a:last").removeClass("disabled");
                $(".pay-money a:last").addClass("toPay");
                if (result.code != 200) {
                  if (result.code == -10001) {
                    alert(result.msg, function () {
                      window.location.href = "/user/login";
                    });
                  } else {
                    alert(result.msg);
                  }
                  return;
                }

                if (result.data.is_payed == 1) {
                  $("#paySuccessModal").modal({
                    backdrop: "static",
                    keyboard: false,
                  });
                  $("#submitLoading").modal("hide");
                  $("#paySuccessModal").modal("show");
                  $("#paySuccessModal a").attr("href", result.data.url);

                  return;
                }

                $("#myModalPay").modal({ backdrop: "static", keyboard: false });
                $("#myModalPay").modal("show");
                $("#myModalPay")
                  .find('input[name="order_sn"]')
                  .val(result.data.trade_id);
                form = $("<form target='_blank'></form>");
                form.attr("action", "/pay/to-pay");
                form.attr("method", "get");
                form.append(
                  $(
                    "<input type='hidden' name='trade_id' value='" +
                      result.data.trade_id +
                      "'/>"
                  )
                );
                form.append(
                  $(
                    "<input type='hidden' name='channel' value='" +
                      result.data.channel +
                      "' />"
                  )
                );
                form.appendTo("body");
                form.submit();
              },
            });
          },
          function () {
            $(".pay-money a:last").removeClass("disabled");
            $(".pay-money a:last").addClass("toPay");
          },
          "center",
          "确认",
          "取消"
        );
      } else {
        $("#msModal8").modal("show");
        $.ajax({
          async: false,
          type: "POST",
          url: "/buy",
          data:
            "discount_id=" +
            id +
            "&goods_id=" +
            goodsId +
            "&pay_channel=" +
            channel +
            dataJson,
          dataType: "json",
          beforeSend: function () {
            if (channel == "balance") {
              $("#submitLoading").modal("show");
            }
          },
          success: function (result) {
            $(".pay-money a:last").removeClass("disabled");
            $(".pay-money a:last").addClass("toPay");
            if (result.code != 200) {
              if (result.code == -10001) {
                alert(result.msg, function () {
                  window.location.href = "/user/login";
                });
              } else {
                alert(result.msg);
              }
              return;
            }

            if (result.data.is_payed == 1) {
              $("#paySuccessModal").modal({
                backdrop: "static",
                keyboard: false,
              });
              $("#submitLoading").modal("hide");
              $("#paySuccessModal").modal("show");
              $("#paySuccessModal a").attr("href", result.data.url);

              return;
            }

            $("#myModalPay").modal({ backdrop: "static", keyboard: false });
            $("#myModalPay").modal("show");
            $("#myModalPay")
              .find('input[name="order_sn"]')
              .val(result.data.trade_id);
            form = $("<form target='_blank'></form>");
            form.attr("action", "/pay/to-pay");
            form.attr("method", "get");
            form.append(
              $(
                "<input type='hidden' name='trade_id' value='" +
                  result.data.trade_id +
                  "'/>"
              )
            );
            form.append(
              $(
                "<input type='hidden' name='channel' value='" +
                  result.data.channel +
                  "' />"
              )
            );
            form.appendTo("body");
            form.submit();
          },
        });
      }
    });

    $(".signature-link").on("click", function () {
      $("#submitLoading").modal("show");
      var appId = $(this).data("id");
      $.post(
        "/sign/publish/" + appId,
        function (data) {
          $("#submitLoading").modal("hide");
          if (data.code == 200) {
            window.location.href = "/publish/success?id=" + data.data.id;
          } else {
            alert(data.msg);
          }
        },
        "json"
      );
    });

    $(".details-preview").on("click", function () {
      var key = $(this).data("key");
      $.post("/sign/to-update/" + key, function (data) {
        if (data.code == 200) {
          window.location.href = "/sign/upload?key=" + key;
        } else if (data.code == -10002) {
          Modal.generalModal({
            backdrop: true, // 点击阴影是否关闭弹窗， // true 开启； false 关闭
            iconClass: "", // success: icon-modal-success1,  error: icon-modal-error2
            title: "", // 弹窗标题
            p: "您的签名已过期，暂时无法更新应用，请续费成功后重试", // 弹窗内容
            align: "left", // 弹窗内容排列顺序 left center right
            cancelBtnText: "取消", // 取消按钮文字
            successBtnText: "续费", // 确定按钮文字
            successBtnModal: true, // 点击确定按钮是否关闭弹窗 true 关闭 false 不关闭
            cancelBtnModal: true, // 点击取消按钮是否关闭弹窗 true 关闭 false 不关闭
            successCallback: function () {
              key = "a0paQnN2Y2FzQlg5TTdzd0RpYTU1Zz09";
              window.location.href = "/sign/upload?key=" + key;
            },
            cancelCallback: function () {},
          });
        } else {
          alert(data.msg);
        }
      });
    });

    Layout.initAddNote({
      callBack: function () {
        var id = $(this).siblings("input[name='id']").val();
        var remark = $.trim($(this).val());
        var _this = $(this);
        $.post(
          "/sign/set-remark",
          { id: id, remark: remark },
          function (data) {
            if (data.code == 200) {
              _this
                .parents(".add-notes-wrap")
                .find(".add-notes")
                .show()
                .find(".text")
                .text(remark);
              if (remark.length > 0) {
                _this
                  .parents(".add-notes-wrap")
                  .find(".add-notes")
                  .find("span:last-child")
                  .text("");
              } else {
                _this
                  .parents(".add-notes-wrap")
                  .find(".add-notes")
                  .find("span:last-child")
                  .text("添加备注");
              }
              _this.hide();
            }
          },
          "json"
        );
      },
    });
    $(".getAppUrl").on("click", function () {
      var id = "0";
      var type = "2";
      $.post("/apps/publish", { type: type, id: id }, function (result) {
        if (result.code == 200) {
          window.location.reload();
        } else {
          alert(result.msg);
        }
      });
    });
    jQuery(".link_qrcode").qrcode({
      render: "canvas", //也可以替换为table
      width: 146,
      height: 146,
      text: decodeURIComponent("https%3A%2F%2Ftap.dierna.com%2F"),
      background: "#ffffff", //二维码的后景色
      foreground: "#000000", //二维码的前景色
      src: "/icons/app-.png?", //二维码中间的图片
    });
  });
</script>
